import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {OperationComponent} from './operation.component';
import {RouterModule, Routes} from '@angular/router';
import {ShareModule} from '../../common/share.module';
import {FormsModule} from '@angular/forms';
import {OperationService} from './operation.service';
import {CashDeskComponent} from './cash-desk/cash-desk.component';
import { OperationListComponent } from './operation-list/operation-list.component';
import { DeshPayComponent } from './desh-pay/desh-pay.component';


const routerConfig: Routes = [
  {
    path: '',
    component: OperationComponent,
    children: [
      {
        path: 'operation-list',
        component: OperationListComponent,
      },
      {
        path: 'cash-desk',
        component: CashDeskComponent,
      },
      {
        path: 'desk-pay',
        component: DeshPayComponent,
      }
    ]
  }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule.forChild(routerConfig),
    ShareModule,
  ],
  declarations: [
    OperationComponent,
    CashDeskComponent,
    OperationListComponent,
    DeshPayComponent,
  ],
  providers: [
    OperationService,
  ]
})
export class OperationModule { }
